<template>
  <div class="page-container">
    <!-- 页面标题区域 -->
    <div class="flex items-center justify-between mb-6">
      <div>
        <h1 class="page-title text-2xl font-bold">{{ title }}</h1>
        <p class="text-gray-500">{{ subtitle }}</p>
      </div>
      <div class="flex gap-2">
        <slot name="actions"></slot>
      </div>
    </div>
    
    <!-- 搜索筛选区域 -->
    <el-card v-if="$slots.search" shadow="hover" class="mb-6 card-with-hover">
      <div class="search-container flex flex-wrap items-center gap-4">
        <slot name="search"></slot>
      </div>
    </el-card>
    
    <!-- 内容区域 -->
    <el-card shadow="hover" class="overflow-hidden card-with-hover">
      <slot></slot>
    </el-card>
  </div>
</template>

<script>
export default {
  name: 'PageLayout',
  props: {
    title: {
      type: String,
      required: true
    },
    subtitle: {
      type: String,
      default: ''
    }
  }
}
</script>

<style scoped>
.page-title {
  position: relative;
  margin-bottom: 4px;
}

.page-title::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 40px;
  height: 3px;
  background-color: var(--el-color-primary);
  border-radius: 3px;
}

.card-with-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 8px;
}

.card-with-hover:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.search-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
</style> 